//
//  NSString+TimeFormatter.m
//  MHMusic
//
//  Created by 马欢 on 16/1/8.
//  Copyright © 2016年 蓝鸥. All rights reserved.
//

#import "NSString+TimeFormatter.h"

@implementation NSString (TimeFormatter)
//+(NSString *)getStringFormateByString:(NSString *)timeString;
+(NSString *)getStringFormateByTime:(float)seconds{
//  分钟  (int)[timeString floatValue]/60// (int)seconds/60
//  秒    (int)[timeString floatValue]%60// (int)seconds%60
   return  [NSString stringWithFormat:@"%02d:%02d",(int)seconds/60,(int)seconds%60];
}
//获取秒数 通过 时间字符串
-(float)getSecondsFomatByTimeString{
    NSArray *tempArr = [self componentsSeparatedByString:@":"];
    return  [[tempArr firstObject] integerValue]*60.0 +[[tempArr lastObject] integerValue];
}

@end
